Skip to content

Conversation

yotamofek
Copy link
Contributor

This showed up in a profile I was looking at, hoping this might improve perf by a little bit.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 15, 2025
@yotamofek yotamofek marked this pull request as ready for review October 15, 2025 19:17
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 15, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@JonathanBrouwer
Copy link
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 15, 2025
Micro-optimization in `FunctionCx::initialize_locals`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 15, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 15, 2025

☀️ Try build successful (CI)
Build commit: 5b26667 (5b2666713c0320f62e357a7c134d7b62824b2daa, parent: 28d0a4a205f9e511ad2f51ee79a4aa19a704a455)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5b26667): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -4.3%, secondary -3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.3% [-6.4%, -2.2%] 2
Improvements ✅
(secondary)
-3.0% [-3.0%, -2.9%] 2
All ❌✅ (primary) -4.3% [-6.4%, -2.2%] 2

Cycles

Results (secondary 2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 474.854s -> 476.04s (0.25%)
Artifact size: 388.09 MiB -> 388.00 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 16, 2025
@yotamofek
Copy link
Contributor Author

Doesn't make a dent in instruction counts, but reduces max RSS in some cases - which makes sense. So I think it's still worth merging.

@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Oct 16, 2025

I'm not entirely convinced that the max RSS isn't just noise, but I think the new code is easier to read anyways, so lets merge this

@bors r+ rollup=iffy
Since this may have some effect on performance this maybe shouldn't be rolled up? It's probably fine tho since its so minimal

@bors
Copy link
Collaborator

bors commented Oct 16, 2025

📌 Commit 9361d64 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 16, 2025
samueltardieu added a commit to samueltardieu/rust that referenced this pull request Oct 17, 2025
…_opt, r=JonathanBrouwer

Micro-optimization in `FunctionCx::initialize_locals`

This showed up in a profile I was looking at, hoping this might improve perf by a little bit.
bors added a commit that referenced this pull request Oct 17, 2025
Rollup of 6 pull requests

Successful merges:

 - #144936 (CFI: Fix types that implement Fn, FnMut, or FnOnce)
 - #147468 (Implement fs api set_times and set_times_nofollow)
 - #147660 (rustdoc-search: stringdex 0.0.2)
 - #147735 (Micro-optimization in `FunctionCx::initialize_locals`)
 - #147764 (Undo CopyForDeref assertion in const qualif)
 - #147783 (bootstrap: migrate to object 0.37)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Oct 19, 2025

⌛ Testing commit 9361d64 with merge e124355...

@bors
Copy link
Collaborator

bors commented Oct 19, 2025

☀️ Test successful - checks-actions
Approved by: JonathanBrouwer
Pushing e124355 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 19, 2025
@bors bors merged commit e124355 into rust-lang:master Oct 19, 2025
13 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 19, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 377a931 (parent) -> e124355 (this PR)

Test differences

Show 4 test diffs

4 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard e1243553b3cdf80c1102457cc256819a3004ea21 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-apple: 6050.8s -> 7236.2s (19.6%)
  2. x86_64-gnu-llvm-20: 2877.6s -> 2446.2s (-15.0%)
  3. i686-gnu-1: 8440.6s -> 7298.5s (-13.5%)
  4. aarch64-apple: 8201.7s -> 7219.4s (-12.0%)
  5. aarch64-gnu-debug: 4324.2s -> 3856.5s (-10.8%)
  6. i686-gnu-2: 5806.7s -> 5267.8s (-9.3%)
  7. x86_64-gnu-gcc: 3421.4s -> 3120.0s (-8.8%)
  8. test-various: 4887.8s -> 4512.4s (-7.7%)
  9. aarch64-gnu: 6692.9s -> 6199.4s (-7.4%)
  10. x86_64-gnu-debug: 7230.4s -> 6698.3s (-7.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e124355): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary -2.0%, secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 472.843s -> 472.911s (0.01%)
Artifact size: 390.56 MiB -> 390.54 MiB (-0.01%)

@yotamofek yotamofek deleted the pr/ssa/initialize_locals_opt branch October 19, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants